package com.oo.polymorphic_4.drink;

/**
 * DrinkFactory--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-09 15:47
 **/
public class DrinkFactory {

    public static Drink getDrink(int id) {
        switch (id) {
            case 1:
                return new Coffee();
            case 2:
                return new Water();
            case 3:
                return new Cola();
            default:
                return null;
        }
    }
}
